package org.example.controller;

import org.example.result.ResultData;
import org.example.service.ICodeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;

/**
 * 验证码操作
 */
@RestController
@RequestMapping(value = "/code")
public class CodeController {

    @Autowired
    private ICodeService codeService;

    /**
     * 生成验证码
     */
    @GetMapping(value = "/generateCode")
    public ResultData generateCode() {
        return ResultData.success(codeService.createCode());
    }

}
